import { getWalletDetail } from '../../../../common/api/index'
Page({
    data: {
		pageNo: 1,
		total: 0,
		dataList: [],
		showLoading: false,
    },
    onLoad() {
		this.getDataList()
    },
    onShow() {

    },
	// 获取平级奖励明细
	getDataList(){
		this.setData({
			showLoading: true
		})
		let data = {
			pageNo: this.data.pageNo,
			pageSize: 10,
			bizCode: 105,//股东分红-105, 平级奖励-106, 推荐奖励-101
		}
		getWalletDetail(data).then(res => {
			if(res.code == 200){
				let data = []
				if(this.data.pageNo == 1){
					data = res.data
				}else{
					data = this.data.dataList.concat(res.data)
				}
				this.setData({
					dataList: data,
					total: res.extend.total,
					showLoading: false
				})
			}
		})
	},
    onReachBottom() {
		if(this.data.total > this.data.dataList.length){
			this.setData({
				pageNo: ++this.data.pageNo,
			})
			this.getDataList()
		}
    }
})